<template>
	<view class="tijicontainer">
	  <view class="flexcenter" v-if="!list.data.length">
	 	<view class="placeholderimg" style="margin-top: 300rpx;">
	 		<image src="../../static/images/bg-icons/placeholderimg.png" mode=""></image>
	 	</view>
	  </view>
	  <view class="itemlist  ffffff">
		 <view class="jiejiitem" v-for="item in list.data" :key="item.id">
		 	<view class="jiejitop flexbetween">
		 		<view class="num">{{item.price}}</view>
		 		<view class="state" v-if="item.status==0">待审核</view>
				<view class="state" v-if="item.status==1">已完成</view>
				<view class="state" v-if="item.status==3">已驳回</view>
		 	</view>
		 	<view class="jiejibottom">
		 		<view class="time">{{item.createtime_text}}</view>
		 	</view>
		 </view>
	  </view>
	</view>
</template>

<script>
 const httpRequest = require("@/common/httpRequest.js")
	export default {
		data() {
			return {
			 list:{
			 	data:[]
			 },
			 limit:12,
			 page:1,
			};
		},
		methods: {
		  init(isPage, page) {
		  	let _this = this;
		  	httpRequest.request('api/user/getWithdrawalList', 'POST', {
		  		page: page || 1,
		  		limit: _this.limit,
		  	}, false, false, true).then(res => {
				console.log(res.data)
		  		if (res.code == 1) {
		  			let resList = res.data;
		  			let dataList = _this.list;
		  			if (isPage == true) {
		  				_this.list.data = dataList.data.concat(resList.data);
		  			} else {
		  				this.list = res.data
		  				_this.list.data = resList.data;
		  			}
		  		}
		  			
		  	}).catch(err => {
		  		httpRequest.toast(err.msg);
		  	})
		  },
		},
		onShow() {
			this.init()
		},
		onReachBottom() {
			let _this = this;
			let list = _this.list;
			let page = _this.page;
			if (list.last_page <= page) {
				return false;
			}
			page++;
			_this.page = page;
			_this.init(true, page);
		},
	}
</script>

<style lang="scss">
.tijicontainer{
	padding-top:30rpx;
	box-sizing: border-box;
	min-height: 100vh;
	background-color: #fafafa;
}
.itemlist{
	padding: 0 30rpx;
}
.jiejiitem{
	padding-top: 30rpx;
	padding-bottom: 30rpx;
	border-bottom:solid 2rpx rgba(241, 241, 241, 1);
	.num{
	  font-size: 32rpx;
	  font-family: DIN Next LT Pro-Bold, DIN Next LT Pro;
	  font-weight: bold;
	  color: #00D2E1;
	  line-height: 38rpx;
	}
	.state{
	  font-size: 24rpx;
	  font-family: PingFang SC-Medium, PingFang SC;
	  font-weight: 500;
	  color: #999999;
	  line-height: 28rpx;
	}
	.time{
		margin-top: 11rpx;
		font-size: 24rpx;
		font-family: PingFang SC-Medium, PingFang SC;
		font-weight: 500;
		color: #999999;
		line-height: 28rpx;
	}
}
</style>
